package com.aliyun.messagemgt.converter;

import com.aliyun.messagemgt.dto.base.*;
import com.aliyun.messagemgt.entities.BaseReceiveGroup;
import com.github.pagehelper.PageInfo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @ClassName: BaseReceiveGroupConverter
 * @Description:
 * @Author: wugongzi
 * @Date: 2021/9/28 11:17
 * @Version: 1.0
 */
@Mapper
public interface BaseReceiveGroupConverter {
    BaseReceiveGroupConverter INSTANCE = Mappers.getMapper(BaseReceiveGroupConverter.class);

    PageInfo<BaseReceiveGroupDTO> baseReceiveGroupPageInfo2baseReceiveGroupDTOPageInfo(PageInfo<BaseReceiveGroup> baseReceiveGroupPageInfo);

    @Mappings({
            @Mapping(expression = "java(\"Y\".equals(baseReceiveGroup.getIsEnabled())?\"启用\":\"停用\")",target = "status")
    })
    BaseReceiveGroupDTO baseReceiveGroup2baseReceiveGroupDTO(BaseReceiveGroup baseReceiveGroup);

    @Mappings({
            @Mapping(source = "creator",target = "modifier")
    })
    BaseReceiveGroup baseReceiveGroupAddCmd2baseReceiveGroup(BaseReceiveGroupAddCmd cmd);

    BaseReceiveGroup baseReceiveGroupUpdateCmd2baseReceiveGroup(BaseReceiveGroupUpdateCmd cmd);

    BaseReceiveGroupDetailDTO baseReceiveGroupDTO2baseReceiveGroupDetailDTO(BaseReceiveGroupDTO baseReceiveGroupDTO);

    PageInfo<BaseReceiveGroupDetailDTO> baseReceiveGroupDTOPageInfo2baseReceiveGroupDetailDTOPageInfo(PageInfo<BaseReceiveGroupDTO> baseReceiveGroupDTOPageInfo);

    List<BaseReceiveGroupDTO> baseReceiveGroupList2baseReceiveGroupDTOList(List<BaseReceiveGroup> baseReceiveGroupList);

    List<BaseReceiveGroupDetailDTO> baseReceiveGroupDTOList2baseReceiveGroupDetailDTOList(List<BaseReceiveGroupDTO> baseReceiveGroupDTOList);

    BaseReceiveGroup baseReceiveGroupQry2baseReceiveGroup(BaseReceiveGroupQry qry);
}
